var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var r, a = arguments.length, i = a < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, n); else for (var s = e.length - 1; 0 <= s; s--) (r = e[s]) && (i = (a < 3 ? r(i) : 3 < a ? r(t, o, i) : r(t, o)) || i);
    return 3 < a && i && Object.defineProperty(t, o, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("AudioManager"), c = e("BaseView"), l = e("GameConfig"), d = e("GameData"), u = e("EggsManager"), p = e("AccelerometerTigger"), h = e("DataManager"), f = e("UIManager"), g = e("WebManager"), m = cc._decorator, y = m.ccclass, v = m.property, w = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.tigger = null, e.root = null, e.skeleton = null, e.idx = 11, e;
    }
    return i(e, t), e.prototype.onLoad = function() {
        l.GC.isVaild(this.text) || -1 != u.default.getInstance().checkEggPerson(this.idx) || (this.tigger.enabled = !0, 
        this.node.on("effect", this.callback, this));
    }, e.prototype.callback = function() {
        var e = this;
        -1 == u.default.getInstance().checkEggPerson(this.idx) && (this.node.off("effect"), 
        this.root.active = !0, s.default.getInstance().playAudio("皮肤出现"), s.default.getInstance().playAudio("彩蛋皮肤" + r.G.eggPersonModelList[this.idx].m, 1), 
        this.skeleton.setAnimation(0, "animation", !1), this.skeleton.setCompleteListener(function() {
            e.skeleton.setCompleteListener(null), e.hidePnl(), g.default.getInstance().sentLog("获得皮肤彩蛋id:" + e.idx), 
            u.default.getInstance().updateEggPerson(e.idx), d.GD.personIdx = -1 - e.idx, d.GD.eggsHintState = 1, 
            h.default.getInstance().save(), f.default.getInstance().loadPopPnl("egg_reward", {
                type: r.RewardType.SKIN,
                idx: e.idx
            });
        }));
    }, a([ v(p.default) ], e.prototype, "tigger", void 0), a([ v(cc.Node) ], e.prototype, "root", void 0), 
    a([ v(sp.Skeleton) ], e.prototype, "skeleton", void 0), a([ y ], e);
}(c.default);

n.default = w;